Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup Literal.__hash__ and Literal.__eq__ by accessing directly _da… #1321

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

rchateauneu
Copy link
Contributor

@rchateauneu rchateauneu commented May 18, 2021

Literal.hash and Literal.eq use self.datatype and self. language properties. It is faster to directly use the private members Literal._dataype and Literal.__language.

Test importing orkg.nt

Before:
image

After:

image

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 75.627% when pulling 282a8b7 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@coveralls
Copy link

coveralls commented May 18, 2021

Coverage Status

Coverage remained the same at 75.705% when pulling 42c90d9 on rchateauneu:speedup_term_hash into 58b23fd on RDFLib:master.

@rchateauneu
Copy link
Contributor Author

rchateauneu commented May 18, 2021

It failed only Python 3.7, but 3.6 and 3.8 worked OK. This is strange because the changes are very simple.

The failed test is:

ERROR: test_query_with_added_rdf_prolog (test.test_sparqlstore.SPARQLStoreDBPediaTestCase)
...
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address

I tend to think that it is a transient error related to a temporary network problem.

Is it possible to rerun a build on the same PR ?

@rchateauneu rchateauneu marked this pull request as ready for review May 20, 2021 06:52
This was referenced May 21, 2021
@nicholascar nicholascar self-requested a review June 28, 2021 23:41
Copy link
Member

@nicholascar nicholascar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about the "cannot assign address" test failure you're noticing: that's spurious and won't prevent this PR going through.

@nicholascar nicholascar merged commit e4d975a into RDFLib:master Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants